package de.freudenreichdesign.webshop.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table (name="ARTICLE")
public class Article implements Serializable {

	private static final long serialVersionUID = 8371550210423143569L;
	private long articleID;
	private String title;
	private String height;
	private String description;
	private String length;
	private String depth;
	private String weight;
	private double price;
	private float tax;
	private Date activeSince;
	private Date inactiveSince;
	private Category category;
	private String imageSmallPath;
	private String imageLargePath;
	
	public Article() {}
	
	public Article(String title, String height,
			String description, String length, String depth, String weight,
			double price, float tax, Date activeSince,
			String imageSmallPath, String imageLargePath) {
		this.title = title;
		this.height = height;
		this.description = description;
		this.length = length;
		this.depth = depth;
		this.weight = weight;
		this.price = price;
		this.tax = tax;
		this.activeSince = activeSince;
		this.imageSmallPath = imageSmallPath;
		this.imageLargePath = imageLargePath;
	}
	
	@Id
	@GeneratedValue (strategy=GenerationType.AUTO)
	@Column (name="ARTICLE_ID")
	public long getArticleID() {
		return articleID;
	}
	
	@SuppressWarnings("unused")
	private void setArticleID(long articleID) {
		this.articleID = articleID;
	}

	@Column (name="TITLE")
	public String getTitle() {
		return title;
	}
	
	public void setTitle(String title) {
		this.title = title;
	}
	
	@Column (name="HEIGHT")
	public String getHeight() {
		return height;
	}
	public void setHeight(String height) {
		this.height = height;
	}
	
	@Column (name="DESCRIPTION")
	public String getDescription() {
		return description;
	}
	
	public void setDescription(String description) {
		this.description = description;
	}
	
	@Column (name="LENGTH")
	public String getLength() {
		return length;
	}
	
	public void setLength(String length) {
		this.length = length;
	}
	
	@Column (name="DEPTH")
	public String getDepth() {
		return depth;
	}
	
	public void setDepth(String depth) {
		this.depth = depth;
	}
	
	@Column (name="WEIGHT")
	public String getWeight() {
		return weight;
	}

	public void setWeight(String weight) {
		this.weight = weight;
	}
	
	@Column (name="PRICE")
	public double getPrice() {
		return price;
	}
	
	public void setPrice(double price) {
		this.price = price;
	}
	
	@Column (name="TAX")
	public float getTax() {
		return tax;
	}
	
	public void setTax(float tax) {
		this.tax = tax;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column (name="ACTIVE_SINCE")
	public Date getActiveSince() {
		return activeSince;
	}
	
	public void setActiveSince(Date activeSince) {
		this.activeSince = activeSince;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column (name="INACTIVE_SINCE")
	public Date getInactiveSince() {
		return inactiveSince;
	}
	
	public void setInactiveSince(Date inactiveSince) {
		this.inactiveSince = inactiveSince;
	}
	
	@OneToOne
	@JoinColumn(name="CATEGORY")
	public Category getCategory() {
		return category;
	}
	
	public void setCategory(Category category) {
		this.category = category;
	}
	
	public void setImageSmallPath(String imageSmallPath) {
		this.imageSmallPath = imageSmallPath;
	}
	
	@Column (name="IMAGE_SMALL_PATH")
	public String getImageSmallPath() {
		return imageSmallPath;
	}
	
	public void setImageLargePath(String imageLargePath) {
		this.imageLargePath = imageLargePath;
	}
	
	@Column (name="IMAGE_LARGE_PATH")
	public String getImageLargePath() {
		return imageLargePath;
	}

}
